<?php
/**
* strings.php
*
* @version 0.1a
* @copyright 2010 by badboy for BadNova
*/

if (!defined('INSIDE'))
{
	die();
}

// striped from string.php
function colorNumber($n, $s = '')
{
	if ($n > 0)
	{
		if ($s != '')
		{
			$s = colorGreen($s);
		}
		else
		{
			$s = colorGreen($n);
		}
	}
	elseif ($n < 0)
	{
		if ($s != '')
		{
			$s = colorRed($s);
		}
		else
		{
			$s = colorRed($n);
		}
	}
	else
	{
		if ($s != '')
		{
			$s = $s;
		}
		else
		{
			$s = $n;
		}
	}
	return $s;
}

function colorRed($n)
{
	return '<font color="#ff0000">' . $n . '</font>';
}

function colorGreen($n)
{
	return '<font color="#00ff00">' . $n . '</font>';
}

function pretty_number($number, $floor = true)
{
	if ($floor)
	{
		$number = floor($number);
	}

	return number_format($number, 0, ',', '.');
}

// -----------------------------------------------------------------------------------------------------------
// History version
// 0.1a - Mise au propre
?>
